home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Games Machine 76
/
XENIATGM66.iso
/
Indiana Jones
/
Indiana Jones.exe
/
RESOURCE
/
PREVIEW.GOB
/
cog_shs_bngate1.cog
< prev
next >
Wrap
Text File
|
1999-11-15
|
5KB
|
183 lines
# Jones 3D Cog Script
#
# SHS_BNgate.cog Make Big Nave gate open/close.
#
# [JWC, SXC]
#
# (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
#
# ========================================================================================
symbols
message activated
message startup
message callback
keyframe inReach=in_activate_medium.key local
sound unlock=tem_monkeykey_unlock_c.wav local
thing gate
thing keyhole
thing player local
thing keyCam
thing gateCam
thing c1_t1
thing c1_t2
thing key
thing indy
thing indy_t1
int keyed=0 local
int olkey=115 local # old lady key inv. number
int whichitem local
int curcam local
int keygrumble local
int in_rotRate local
cog doortalkcog
end
# ========================================================================================
code
startup:
player= GetLocalPlayerThing();
SetThingLight(gate, '0.2 0.2 0.2', 0.01, 0.01);
SetThingFlags(key, 0x80000);
in_rotRate = GetThingMaxRotVel(indy); # remember Indy rate
return;
activated:
# check for oldlady key to open gate
if (GetSenderRef() == keyhole)
{
if (keyed==1) return;
# check if inventory is being used...
whichItem = GetCurItem(player);
# Prep for scene...
SetActorFlags(player, 0x200000);
StartCutScene(1);
StopThing(player);
DeselectWeapon(player); # stow any weapon or lighter
DeselectWeaponWait(player);
CopyPlayerHolsters(player, indy); # make sure our actor has matching props
Sleep(0.1); # wait a beat
# Cut to Indy opening lock
curCam = GetCurrentCamera();
SetCameraLookInterp(2, 0); # no pan & tilt
SetCameraPosInterp(2, 0); # no dolly
SetCameraFocus(2, keyCam);
SetCameraSecondaryFocus(2, c1_t1);
Sleep(.1);
SetCurrentCamera(2);
SetCameraFOV(75, 0, 0);
# Switch actor indy for player...
SetThingFlags(player, 0x80000); # hide him
ClearThingFlags(indy, 0x80000); # reveal our actor
if ((whichItem == olkey) && (keyed == 0))
{
# Look and reach, Indy
AISetLookThing(indy, keyhole);
PlayKey(indy, inReach, 4, 0x12, 0);
ChangeInv(player, olKey, -1);
Sleep(.2);
ClearThingFlags(key, 0x80000);
# play sound of key opening
PlaySoundLocal(unlock, 1.0, 0.0, 0x0, 0);
sleep(.5);
# Pan over to gate
SetCameraLookInterp(2, 1); # pan & tilt
SetCameraPosInterp(2, 1); # dolly
SetCameraInterpSpeed(2, 2.0);
Sleep(0.01);
SetCameraFocus(2, gateCam);
SetCameraSecondaryFocus(2, c1_t2);
SetCameraFOV(65, 1, 2.0);
in_rotRate = GetThingMaxRotVel(indy); # remember Indy rate
SetThingMaxRotVel(indy, 35.0);
AISetLookThing(indy, indy_t1);
sleep(1);
# open gate
MoveToFrame(gate, 1, 1.0);
WaitForStop(gate);
keyed=1; # plays only once
# Indy notes success
SendMessageEx(doortalkcog, user1, player, 1, 4, 0);
while (global15 == 0)
{
Sleep(0.01); # wait for line to finish
}
}
else
{
if (whichItem != 0)
{
# Take care of wrong keys and items...
PlayKey(indy, inReach, 4, 0x12, 0);
Sleep(0.3);
SendMessageEx(doortalkcog, user0, indy, olKey, whichItem, 0);
}
else
{
if (keygrumble == 0)
{
# Note need for key 1st time thru...
SendMessageEx(doortalkcog, user4, indy, 1, 3, 0);
keygrumble = 1;
}
else
{
# General "door is locked" grmubling thereafter...
SendMessageEx(doortalkcog, user4, indy, 0, 0, 0);
}
}
while (global15 == 0)
{
Sleep(0.01); # wait for line to finish
}
}
Sleep(0.3);
SetThingMaxRotVel(indy, in_rotRate);# reset indy rotate velocity
CopyOrientAndPos(indy, player); # move player to actor's spot
SetCameraPosition(1, GetThingPos(keyCam)); # prep to swing back to follow-cam
SetCameraLookInterp(2, 0); # kill pan & tilt mode
SetCameraPosInterp(2, 0); # kill dolly mode
sleep(.01);
ResetCameraFOV(0, 0.0);
SetCurrentCamera(1);
SetThingFlags(indy, 0x80000);
ClearThingFlags(player, 0x80000);
ClearActorFlags(player, 0x200000);
EndCutscene();
}
return;
end